import axios from 'axios'
export default {
    getStrategy(callback,data){
        axios.get('/v1/api/admin/strategies').then(response => {
            callback(response.data.data)
        })
    },
    getArticles(callback,id){
        axios.get('/v1/api/admin/articles?id='+id).then(response => {
            callback(response.data.data)
        })
    },
    getArticle(callback,id){ 
        axios.get('/v1/api/article/cotnent?id='+id).then(response => {
            callback(response.data)
        })
    },
    getFocusImg(callback){
        axios.get('/v1/api/admin/focus/imgs').then(response => {
            callback(response.data)
        })
    },
    updateFocusImg(callback,data){
        axios.post('/v1/api/admin/focus/img',data,{headers:{
           'Content-Type': 'multipart/form-data'
          }}).then(response => { 
              callback(response.data.data)
          })
    },
    delFocusImg(callback,id){
        axios.delete('/v1/api/admin/focus/img?id='+id).then(response => {
            callback(id)
        })
    },
    //攻略管理相关API
    upateStrategy(callback,data){
        axios.post('/v1/api/admin/strategy',data,{headers:{
           'Content-Type': 'multipart/form-data'
          }}).then(response => {
              callback(response.data)
          })
    }
    //攻略管理相关API
}